﻿workspace "Empyrean"
	architecture "x64"
	configurations { "Debug", "Release", "Dist" }

outputdir = "%{cfg.buildcfg}-%{cfg.system}-%{cfg.architecture}"

-- Include directories relative to root folder (solution directory)
IncludeDir = {}
IncludeDir["GLFW"] = "Empyrean/vendor/GLFW/include"
include "Empyrean/vendor/GLFW"

project "Empyrean"
	location "Empyrean"
	kind "SharedLib"
	language "C++"
	targetdir ("bin/" .. outputdir .. "/%{prj.name}")
	objdir ("bin-int/" .. outputdir .. "/%{prj.name}")

	pchheader "EmpyreanPCH.h"
	pchsource "Empyrean/src/EmpyreanPCH.cpp"

	files { 
		"%{prj.name}/src/**.h",
		"%{prj.name}/src/**.cpp",
	}
	includedirs {
		"%{prj.name}/vendor/spdlog/include",
		"%{prj.name}/src",
		"%{IncludeDir.GLFW}",
	}
	links {
		"GLFW",
		"opengl32.lib"
	}

	filter "system:windows"
		cppdialect "C++17"
		staticruntime "On"
		systemversion "latest"
		defines {
			"ER_PLATFORM_WINDOWS",
			"ER_BUILD_DLL"
		}
		postbuildcommands {
			("{COPY} %{cfg.buildtarget.relpath} ../bin/" .. outputdir .. "/Sandbox")
		}
	filter "configurations:Debug"
		defines { "ER_DEBUG", }
		symbols "On"
	filter "configurations:Release"
		defines { "ER_RELEASE" }
		optimize "On"
	filter "configurations:Dist"
		defines { "ER_DIST" }
		optimize "On"

project "Sandbox"
	location "Sandbox"
	kind "ConsoleApp"
	language "C++"
	targetdir ("bin/" .. outputdir.. "/%{prj.name}")
	objdir ("bin-int/" .. outputdir.. "/%{prj.name}")
	files { 
		"%{prj.name}/src/**.h",
		"%{prj.name}/src/**.cpp",
	}
	includedirs {
		"Empyrean/vendor/spdlog/include",
		"Empyrean/src"
	}
	links {
		"Empyrean"
	}
	filter "system:windows"
		cppdialect "C++17"
		staticruntime "On"
		systemversion "latest"
		defines {
			"ER_PLATFORM_WINDOWS",
		}
	filter "configurations:Debug"
		defines { "ER_DEBUG", }
		symbols "On"
	filter "configurations:Release"
		defines { "ER_RELEASE" }
		optimize "On"
	filter "configurations:Dist"
		defines { "ER_DIST" }
		optimize "On"



